/******************************************************************************\
*  Animeshell 1.0 Multimedia manager                                           *
*  Copyright (C) 2006-2007 Rémy Guillemette <shaikadzari@gmail.com>            *
*                                                                              *
*  This program is free software; you can redistribute it and/or modify        *
*  it under the terms of the GNU General Public License version 2 only as      *
*  published by the Free Software Foundation.                                  *
*                                                                              *
*  This program is distributed in the hope that it will be useful,             *
*  but WITHOUT ANY WARRANTY; without even the implied warranty of              *
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               *
*  GNU General Public License for more details.                                *
*                                                                              *
*  You should have received a copy of the GNU General Public License           *
*  along with this program; if not, write to the                               *
*  Free Software Foundation, Inc.,                                             *
*  59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.                   *
\******************************************************************************/

#ifndef MYSQLITECLASS_H
#define MYSQLITECLASS_H
//
#include "sqlclassbase.h"
#include <QList>
#include <QStringList>
//

/*! 
    \class mysqliteclass
    \brief Animeshell sqlite class.

    This class is used to communicate the sqlite database. It inherit
    of sqlclassbase to open and close the database.
    
    \author Rémy Guillemette <rguillemette@b2b2c.ca>
    \version 1.0.2 
*/
class mysqliteclass : public sqlclassbase
{
	public:

		/*! mysqliteclass(QString pDriver, QString pDatabase, QString pUser, QString pPasswd)
		    \brief mysqliteclass contructor
		    
		    Inherit of sqlclassbase. Each parameter this constructor received is used
		    by sqlclassbase.
		    
		    \param[in] pDriver Database driver to use
		    \param[in] pDatabase Database to open
		    \param[in] pUser User login to use
		    \param[in] pPasswd User password to use
		*/
		mysqliteclass(QString pDriver, QString pDatabase, QString pUser, QString pPasswd);
		
		
		/*! GetLineFromTable()
		    \brief Get each line of animedb table
		    \return QList<animeclass> with all values
		*/
		virtual QList<animeclass> GetLineFromTable();
		
		
		/*! GetLineFromTable(int pNoSeq)
		    \brief Overloaded function
		    \param[in] pNoSeq sequence number of the searched animeclass object
		    \return animeclass equal to sequence number
		*/
		virtual animeclass GetLineFromTable(int pNoSeq);
		
		/*! GetLastInsert()
			\brief Get last line being inserted in animedb table
			\return animeclass object
		*/
		virtual animeclass GetLastInsert();
		
		/*! SetNewLineInTable(animeclass pNewLine)
		    \brief Insert a new line in animedb table
		    \param[in] pNewLine An animeshell object with all data
		    \return True if the sqlquery end correctly
		*/
		virtual bool SetNewLineInTable(animeclass pNewLine);
		
		
		/*! UpdateTable(animeclass pLine)
		    \brief Update a specific line in table
		    \param[in] pLine An animeshell object with all data
		    \return True if the sqlquery end correctly
		*/
		virtual bool UpdateTable(animeclass pLine);
		
		
		/*! DeleteLineFromTable(int pNoSeq)
			\brief Delete a line from table
			\param[in] pNoSeq Primary key of the line to delete
			\return True is the sqlquery end correctly
		*/
		virtual bool DeleteLineFromTable(int pNoSeq);
		
		/*! AdvSearchInTable(animeclass pSearch, bool pStrict)
		    \brief Search animeclass object in table
		    
		    This function return each lines from table and used QString operator
		    to search similar animeclass object. This is slower than sqlite functions
		    but more efficient.
		    
		    \param[in] pSearch An animeshell object with all data to search
		    \param[in] pStrict Specify to use the strict search option
		    \return QVector<animeclass> with all found lines
		*/
		//virtual QList<animeclass> AdvSearchInTable(animeclass pSearch, bool pStrict);
		
		
		/*! size()
			\brief Get the number of animeclass in the QList
			\return int number of animeclass
		*/
		int size();
		
		///////////////////////////////////////////////////////////////
	
};
#endif
